Skip to content

[CON-3065] feat(gusto): Gusto-write/delete#2976

Merged
immdipu merged 9 commits into
mainfrom
gusto-write
May 21, 2026
Merged

[CON-3065] feat(gusto): Gusto-write/delete#2976
immdipu merged 9 commits into
mainfrom
gusto-write

Conversation

@ejoo
Copy link
Copy Markdown
Contributor

@ejoo ejoo commented May 8, 2026

Installation

Gusto using OAuth 2.0 Authorization Code grant. Both production (api.gusto.com) and sandbox (api.gusto-demo.com, registered as gustoDemo) are supported.

  • Connector uses internal/components
  • Metadata uses V2 metadata format
  • Read supports pagination and incremental sync
  • Raw response is returned as is for READ & METADATA, no formatting or flattening is performed.
  • Write payloads should accept what ReadResults.Fields is returning. Any unnecessary nesting around the input is removed.
  • Provider errors are mapped if non-standard (errors with 200 response code are converted to 4XX)
  • Custom fields, if not human readable names, are resolved to readable names.
  • Unit tests cover read/write/metadata logic (placed in /tests/)
  • Appropriate object names are used. Objects need to be resources, not actions (jobs and not jobs.list).
  • Modules are only being added because:
    • They share the same authentication scheme
    • The same base URL cannot be used to make a proxy call to objects in all modules
    • Different base URLs (drive.google.com vs google.com)
    • Object name collisions (same object name exists in two or more modules)

Summary

Adds Write + Delete support for the Gusto deep connector.

Object scope (17 objects):

  • Company-scoped CREATE: employees, locations, departments, contractors, payrolls, pay_schedules, earning_types, company_benefits, admins, contractor_payments, custom_fields
  • Employee-scoped CREATE (employee_id from RecordData): jobs, employee_benefits, garnishments, home_addresses, work_addresses
  • Job-scoped CREATE (job_id from RecordData): compensations
  • Top-level UPDATE (PUT /v1/{object}/{uuid}, version-required): all of the above
  • Company-scoped UPDATE (PUT /v1/companies/{cid}/{object}/{uuid}): earning_types, pay_schedules, payrolls
  • Update-only: companies
  • Create-only: admins, contractor_payments
  • DELETE (where Gusto exposes it): employees, jobs, compensations, home_addresses, work_addresses, employee_benefits, company_benefits, departments, earning_types

Unit Tests

Write

image

Delete

image

Live Tests

image image image image

ejoo added 7 commits April 7, 2026 21:56
- Use common.MakeRecordsFunc via a recordsFunc helper with a doc comment
  explaining that schemas.json uses responseKey="" because Gusto returns
  bare JSON arrays at the root (handled via jsonquery.SelfReference).
- Drop the redundant employeeScopedPath map; its values were always equal
  to the keys, so use params.ObjectName directly as the child URL suffix.
- Cap PageSize at maxPageSize=100 via a pageSize() helper. Without this,
  if Gusto silently caps per server-side below the user-requested value,
  our "records < per" end-of-pages check would mis-detect the last page.
- Enhance read_test.go: the employees and jobs tests now use
  ComparatorSubsetRead and assert Raw preserves fields that were not
  requested (email on employees; rate/payment_unit/primary on jobs),
  proving raw responses are not altered.
- Extract extractUUIDs and fetchChildrenForEmployees helpers to bring
  parseEmployeeScopedResponse under the funlen 60-line limit.
- Extract queryParamIntOrDefault, defaultPageSizeInt, and cloneURL
  helpers to bring nextPageFromPageCounter under the cyclop
  complexity-10 limit.
- Rephrase a comment to avoid the typos linter flagging "mis-detect".
@ejoo ejoo requested a review from jlimatampersand May 8, 2026 17:00
@linear
Copy link
Copy Markdown

linear Bot commented May 8, 2026

CON-3065

Base automatically changed from gusto-read to main May 21, 2026 17:24
@immdipu immdipu merged commit 138b80d into main May 21, 2026
5 checks passed
@immdipu immdipu deleted the gusto-write branch May 21, 2026 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants